package com.beauty.dressing.module.market.holder;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.beauty.dressing.R;
import com.beauty.dressing.common.base.BaseRecyclerViewHolder;
import com.beauty.dressing.common.bean.WriteOrderBean;
import com.beauty.dressing.rxandroid.api.ApiManager;
import com.xiaolanba.commonlib.fresco.FrescoUtil;

/**
 * @author xutingz
 * @E-mail xutz@xianlanba.com
 * @date 2018/5/27
 */
public class WriteOrderItemHolder extends BaseRecyclerViewHolder<WriteOrderBean> {
    private SimpleDraweeView mShopImg;
    private TextView mNameTxt, mPriceTxt, mNumTxt;

    public WriteOrderItemHolder(Context context, LayoutInflater inflater, ViewGroup viewGroup) {
        super(R.layout.write_order_item, context, inflater, viewGroup);
    }

    @Override
    public void findView() {
        mShopImg = itemView.findViewById(R.id.shop_img);
        mNameTxt = itemView.findViewById(R.id.name_txt);
        mNumTxt = itemView.findViewById(R.id.num_txt);
        mPriceTxt=itemView.findViewById(R.id.price_txt);
    }

    @Override
    public void bindData(WriteOrderBean bean, int position) {
        FrescoUtil.loadImage(mShopImg, ApiManager.HEAR_URL + bean.image);
        mNameTxt.setText(bean.name);
        mPriceTxt.setText("¥"+bean.price);
        mNumTxt.setText("x " + bean.number);
    }
}
